<template>
  <div class="mod-hotSearcch">
    <div class="title">满额起送</div>
    <div class="notice">
      提示：设置订单最低起送金额
    </div>
    <div class="setting-box">
      <div class="setting-item">
        <span class="item-tit">满额起送：</span>
        <el-input v-model="startPrice"></el-input>
      </div>
      <div class="setting-btn setting-=item">
        <el-button type="primary" @click="submit">保存</el-button>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  data () {
    return {
      startPrice: 0,
    }
  },
  methods: {
    getMyInfo(){
      this.$http({
        url:this.$http.adornUrl("/shop/shopDetail/getShopDetailInformation"),
        method: 'get',
      }).then(({data}) =>{
        this.startPrice = data.startPrice
      }) 
    },

    submit(){
      this.$http({
        url: this.$http.adornUrl('/shop/shopDetail/updateInformation'),
        method: 'put',
        params: this.$http.adornParams({
          startPrice: this.startPrice
        })
      }).then((res) =>{
        this.$message({
          message: '保存成功',
          type: 'success',
          duration: 1500
        })
      })
    },
  },

  created(){
    this.getMyInfo()
  }
}
</script>

<style scoped>
.title{
  margin-left: 30px;
  color: #444;
  font-size: 24px;
}
.title::before{
  content: '';
  border-right: 3px solid #02A1E9;
  margin-right: 5px;
}
.notice{
  margin: 15px 0 0 35px;
  color: #888;
}
.setting-box{
  width: 600px;
  border: 1px solid #EBEEF5;
  padding: 30px 105px;
  margin: 30px auto;
}
.setting-item{
  margin: 10px 0;
}
.setting-box .setting-item .item-tit{
  width: 60px;
}
.setting-btn{
  margin: 30px 0 0 72px;
}
.el-input{
  width: 300px;
}
.el-button{
  width: 100px;
}
</style>